/*
 * @Author: yuanming
 * @Date: 2024-06-30 08:01:12
 * @LastEditors: yuanming
 * @LastEditTime: 2024-08-30 15:44:27
 * @Description: fileDescription
 */
import { createWebHashHistory, createRouter } from 'vue-router'

export const constantRoutes = [
    {
        path: '/:pathMatch(.*)*',
        component: () => import('@/views/error/404'),
        hidden: true,
    },
    {
        path: '',
        component: () => import('@/views/index/index'),
        hidden: true,
    },
    {
        path: '/login',
        component: () => import('@/views/login/index'),
        hidden: true,
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes: constantRoutes,
    scrollBehavior(to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition
        }
            return { top: 0 }
    },
})

export default router
